package com.yiqi.news.mvp.model

import android.app.Application
import com.google.gson.Gson
import com.jess.arms.integration.IRepositoryManager
import com.jess.arms.mvp.BaseModel

import com.jess.arms.di.scope.ActivityScope
import com.yiqi.news.app.utils.PreUtils
import com.yiqi.news.entity.BaseResponse
import com.yiqi.news.entity.News
import com.yiqi.news.entity.NewsResponse
import com.yiqi.news.entity.Page
import javax.inject.Inject

import com.yiqi.news.mvp.contract.VideoListContract
import com.yiqi.news.mvp.model.api.service.CommonService
import com.yiqi.news.mvp.model.api.service.NewsService
import io.reactivex.Observable


/**
 * ================================================
 * Description:
 * <p>
 * Created by MVPArmsTemplate on 06/11/2019 10:28
 * <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
 * <a href="https://github.com/JessYanCoding">Follow me</a>
 * <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
 * <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
 * <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
 * ================================================
 */
@ActivityScope
class VideoListModel
@Inject
constructor(repositoryManager: IRepositoryManager) : BaseModel(repositoryManager), VideoListContract.Model {

    override fun getNewsList(page: Int, limit: Int, materialType: Int, labelCode: String): Observable<BaseResponse<Page<News>>> {
        return mRepositoryManager.obtainRetrofitService(NewsService::class.java).newsList(page, limit, materialType, labelCode)
    }


    @Inject
    lateinit var mGson: Gson;
    @Inject
    lateinit var mApplication: Application;

    override fun onDestroy() {
        super.onDestroy();
    }
}
